package api

import (
	"FeedXmh/app/dao"
	"github.com/gogf/gf/frame/g"
	"github.com/gogf/gf/net/ghttp"
)

var Public = public{}

type public struct {
}

func (a *public) AppInfo(r *ghttp.Request) {
	res := g.Map{
		"code":  0,
		"msg":   "",
		"data":  nil,
		"count": 0,
	}

	list, err := dao.T_app_info.GetList("")
	if err != nil {
		res["msg"] = err.Error()
		res["code"] = -1
	} else {
		if len(list) > 0 {
			res["code"] = 0
			res["data"] = list[0]
		} else {
			res["msg"] = "empty data"
			res["code"] = -1
		}
	}
	r.Response.WriteJson(res)
	r.ExitAll()
}
